<?php

namespace DP\Filter;

use DP\Filter\CriteriaInterface;

class AndCriteria implements CriteriaInterface
{
    private $one, $another;

    public function __construct(CriteriaInterface $one, CriteriaInterface $another)
    {
        $this->one = $one;
        $this->another = $another;
    }

    public function meetCriteria($persons)
    {
        $data = $this->one->meetCriteria($persons);
        $data = $this->another->meetCriteria($data);

        return $data;
    }
}
